window.Language = (function(){
    var language = window.language = window.language || { cultures: {} },
        util = new UTIL(),
        EN = "en",
        STRING = "string";

    language.cultures["en"] = {
        name: "en",
        text : {
            "require_check" : "{0} is required and can\'t be empty",
            "length_check"  : "{0} must be more than {1} and less than {2} characters long",
            "email_check"   : "The input is not a valid email address",
            "confirm_check" : "{0} and {1} are not the same"
        }
    }

    function findCulture(culture) {
        if (culture) {
            if (typeof culture === STRING) {
                var cultures = language.cultures;
                return cultures[culture] || cultures[culture.split("-")[0]] || null;
            }

            return null;
        }

        return null;
    }

    function getCulture(culture) {
        if (culture) {
            culture = findCulture(culture);
        }
        return culture || language.cultures.current;
    }


    language.culture = function(cultureName) {
        var cultures = language.cultures, culture;

        if (cultureName !== undefined) {
            culture = findCulture(cultureName) || cultures[EN];
            cultures.current = culture;

        } else {
            return cultures.current;
        }
    };



    function Language(cultureName){
        language.culture(cultureName);
        return language;

    }

    language.findCulture = findCulture;
    language.getCulture = getCulture;

    return Language;
})();